public class ArrayTest {
    public static void main(String[] args){
        int a[]=new int[10];
        for (int i=0;i<a.length;i++)
            a[i]=(int)(Math.random()*100);
        int max,min,sum;
        float average;
        max=min=sum=a[0];
        for (int i=1;i<a.length;i++)
        {
            sum=sum+a[i];
            if (a[i]>max)
                max=a[i];
            if (a[i]<min)
                min=a[i];
        }
        average=sum/10.0f;
        System.out.print("数组元素");
        for (int i=0;i<a.length;i++)
            System.out.print(a[i]+"");
        System.out.print("\n最大值:"+max+",最小值："+min);
        System.out.println("平均值:"+average);
    }
}
